<DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
	<title>血糖记录单</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<link rel="stylesheet" type="text/css" href="../../css/jquery.mobile-1.4.0.css" />
	<link rel="stylesheet" type="text/css" href="../../css/zpdydhl_mobile.css">
	<link rel="stylesheet" type="text/css" href="../../css/mobiscroll.custom-2.6.2.min.css">
	<script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.mobile-1.4.0.min.js"></script>
	<script type="text/javascript" src="../../js/zpdydhl_mobile.js"></script>
	<script type="text/javascript" src="../../js/mobiscroll.custom-2.6.2.min.js"></script>
</head>
<body>
	<div data-role="page" data-theme="c" id="page">
	 	
		<style type="text/css">
			.hulijilu_table{border-collapse:collapse; width:100%}
			.hulijilu_table tr td{border:1px solid #c5dbf2;height:36px;}
			.content_edit{border:1px dashed #1e8cc3;display:block;min-height:30px;line-height:30px;word-break: break-all;word-wrap: break-word;}
			.hulijilu_table_title{color:#027fbd;padding-left:10px;}
			ul.yibanqingkuang{margin:0px;margin-top:5px;}
			ul.yibanqingkuang li{list-style-type:none;background:#fff;border-radius:3px;color:#333;float:left;padding:5px;margin:5px;font-weight:normal;font-size:14px;}
			ul.yibanqingkuang li:active{list-style-type:none;background:#017Aa0;border-radius:3px;color:#fff;float:left;padding:5px;margin:5px;font-weight:normal;font-size:14px;}
			#huli_record_time,#huli_record_time:focus{border:1px solid #c5dbf2;}
		</style>
		<div style="margin:0 10px;">
			<table border="0" cellpadding="0" cellspacing="0" class="hulijilu_table">
				<tr>
					<td colspan="2" class="hulijilu_table_title">
						录入时间：<input type="text" name="huli_record_time" id="huli_record_time" value="" data-role="none" style="text-align:center;">
					</td> 
				</tr>
				<tr>
					<td width="150px" class="hulijilu_table_title">早餐前血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol1" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol16"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">早餐后血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol2" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol17"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">午餐前血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol3" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol18"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">午餐后血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol4" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol19"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">晚餐前血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol5" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol20"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">晚餐后血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol6" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol21"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">睡前血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol7" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol22"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">凌晨3点血糖</td>
					<td><div contentEditable="true" class="content_edit" name="valcol8" zidingyi="next" keyboard="divpingbi"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="valcol23"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">备注</td>
					<td><div contentEditable="true" class="content_edit" name="content" zidingyi="next"></div></td>
				</tr>
				<tr>
					<td class="hulijilu_table_title">签名</td>
					<td><div qianming_edit="true" contentEditable="true" class="content_edit" name="jilu_hushi_name"></div></td>
				</tr>
			</table>
		</div>
		<div data-role="footer" style="background:#4b5c66;display:none;" data-position="fixed" data-tap-toggle="false">
			<ul class="yibanqingkuang">
			</ul>
		</div>
		<script type='text/javascript'>
		$(function () {
			huli_wenshu_id=getRequestOne("huliwenshu_id")
			selectInputTime("huli_record_time",true);
			//setHeader();
			//document_type_global = "addhulijilu";
			document_type_global = "addXuetangJiludan";
			f2_key_number = 0;

			//f2键快速切换
			$('[zidingyi="next"]').click(function()
			{
				var inputs = $('[zidingyi="next"]'); //先取得所有input元素
				f2_key_number = inputs.index($(this)) + 1;
			})

			$('[qianming_edit="true"]').each(function(){
				$(this).html(nurse_info_global.user_name);
			});
		});
		$("#huli_save").die().live("click",function(){
			$.ajax({
				type: "get",
				async: false,
				url:server_url+"HuliJilu/addHulijiluMobile"+yiyuan_id,
				data: {
					zhuyuan_id:patient_info_global.zhuyuan_id,
					huli_wenshu_id:huli_wenshu_id,
					content:$("[name='content']").html(),
					jilu_hushi_name:$("[name='jilu_hushi_name']").html(),
					jilu_hushi_id:nurse_info_global.id,
					jilu_time:$('#huli_record_time').val(),
					valcol1:$("[name='valcol1']").html(),
					valcol2:$("[name='valcol2']").html(),
					valcol3:$("[name='valcol3']").html(),
					valcol4:$("[name='valcol4']").html(),
					valcol5:$("[name='valcol5']").html(),
					valcol6:$("[name='valcol6']").html(),
					valcol7:$("[name='valcol7']").html(),
					valcol8:$("[name='valcol8']").html(),
					valcol16:$("[name='valcol16']").html(),
					valcol17:$("[name='valcol17']").html(),
					valcol18:$("[name='valcol18']").html(),
					valcol19:$("[name='valcol19']").html(),
					valcol20:$("[name='valcol20']").html(),
					valcol21:$("[name='valcol21']").html(),
					valcol22:$("[name='valcol22']").html(),
					valcol23:$("[name='valcol23']").html()
					},
				dataType: "jsonp",
				jsonp: "callbackAddHulijiluMobile",
				jsonpCallback:"feedBackStateAddHulijiluMobile",
				error:function(mes)
				{
					alert(mes);
				},
				success: function(result) {
					if(result.ret=="success")
					{
						alert("数据保存成功");

						window.location.href="./editXuetangJiludan.html?huliwenshu_id="+huli_wenshu_id+"&type="+getRequestOne("type")+"&host_ip="+host_ip+"&user_number="+nurse_info_global.user_number+"&user_name="+nurse_info_global.user_name+"&user_department="+nurse_info_global.user_department+"&patient_id="+patient_info_global.patient_id+"&patient_zhuyuan_id="+patient_info_global.zhuyuan_id+"&patient_zhuyuan_bingqu="+patient_info_global.zhuyuan_bingqu+"&patient_bingchuang_hao="+patient_info_global.bingchuang_hao+"&patient_xingming="+patient_info_global.xingming+"&patient_xingbie="+patient_info_global.xingbie+"&patient_nianling="+patient_info_global.nianling;
					}
					else
					{
						alert("数据保存失败");
					}
				}
			});
		});
		$(".prev").die().live("click",function(){
			javascript:history.go(-1)
		});
		$("[name='content']").focus(function(){
			$('.ui-footer').css('display','block')
			$.ajax({
				type: "get",
				async: false,
				url:server_url+"Moblie/HuliJilu/hulijiluTemplate"+yiyuan_id,
				dataType: "jsonp",
				jsonp: "callbackHulijiluTemplate",
				jsonpCallback:"feedBackStateHulijiluTemplate",
				error:function(mes)
				{
					alert(mes);
				},
				success: function(result) {
					if(result.ret=="success")
					{
						str ='';
						for(var i=0;i<result.data.length;i++)
						{
								str +='<li class="yibanqingkuang_text" shuoming="'+result.data[i].shuoming+'">'+result.data[i].zhongwen_mingcheng+'</li>';
							
						}
						$('.yibanqingkuang').html(str);
					}
					else
					{
						alert("数据保存失败");
					}
				}
			});
		})
		$(".yibanqingkuang_text").live('click',function(){
			$("[name='content']").html($(this).attr('shuoming'));
		})
		</script>
	</div>
</body>
</html>